package com.cqc.customdialog01;


import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends BaseActivity {

    Context context = this;
    Button btn1;
    Button btn2;
    private Button btn3;
    private Button btn4;
    private Button btn5;
    private Button btn6;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        btn1 = (Button) this.findViewById(R.id.btn1);
        btn2 = (Button) this.findViewById(R.id.btn2);
        btn3 = (Button) findViewById(R.id.btn3);
        btn4 = (Button) findViewById(R.id.btn4);
        btn5 = (Button) findViewById(R.id.btn5);
        btn6 = (Button) findViewById(R.id.btn6);

        btn1.setOnClickListener(listener);
        btn2.setOnClickListener(listener);
        btn3.setOnClickListener(listener);
        btn4.setOnClickListener(listener);
        btn5.setOnClickListener(listener);
        btn6.setOnClickListener(listener);

    }

    private View.OnClickListener listener = new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            switch (v.getId()) {
                case R.id.btn1:
                    ProgressDialogUtil2.getInstance(context).show();
                    break;
                case R.id.btn2:
                    ProgressDialogUtil2.getInstance(context).cancle();
                    break;

                case R.id.btn3:
                    ProgressDialogUtil.getInstance(context).showProgressDialog();

                    break;
                case R.id.btn4:
                    ProgressDialogUtil.getInstance(context).dismissProgressDialog();

                    break;
                case R.id.btn5:
                    showProgress();
                    break;
                case R.id.btn6:
                    dismissProgress();
                    break;
            }
        }
    };


}
